(define (call-with-input-file f p)
  (let ((port (open-input-port f)))
    (let ((res (p port)))
      (close-port port)
      res)))


(for-each print (let ((q (empty-queue)))
     (call-with-input-file (car argv)
       (lambda (port)
         (tokenize q port)
         (queue:top q)))))
